<%= form.input :secret_sharing_grants do %>
  <% if grants = SecretSharingGrant.where(key: secret.fetch(:key)).presence %>
    <% grants.each do |grant| %>
      <ul>
        <li>Project <%= link_to_resource grant.project %> since <%= link_to render_time(grant.created_at, params[:time_format]), grant %></li>
      </ul>
    <% end %>
  <% end %>

  <% if current_user.admin? %>
    <%= link_to "Grant sharing", new_secret_sharing_grant_path(secret_sharing_grant: {key: secret.fetch(:key)}) %>
  <% else %>
    Ask and admin to use this secret in your project.
  <% end %>
<% end %>
